// pages/login/login.js
var _check = require('../../utils/check.js');
var _tip = require('../../utils/tip.js');
var _swit = require('../../utils/swit.js');
Page({
  data: {
    logoUrl: '../../images/register_logo.png',
    subLogoUrl: '../../images/register_ozner.png'
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
  },
  onReady: function () {
    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
  formSubmit: function (e) {
    this.setData({ isFocusInputId: '' });
    console.log('form发生了submit事件，携带数据为：', e.detail.value)
    var _paramObj = e.detail.value;
    let _phonenum = _paramObj.phonenum;
    if (_phonenum == '') {
      _tip.toast('请输入手机号码!');
      return;
    }
    if (!_check.isPhone(_phonenum)) {
      _tip.toast('手机号码格式有误!');
      return;
    }
    _swit.back(1);
    setTimeout(function(){
    _swit.switClose("../home/home");
    },500);

  }
})